<?php
$this->headTitle('Page edit');
$this->placeholder('content_title')->set('Create Your Page');
$this->placeholder('body_onload')
     ->set('document.formPostEdit.post_title.focus();');
?>

<div>
    <form name="formPageEdit" id="formPageEdit" method="post"
        action="<?php echo $this->U('page', 'save'); ?>">

        <?php echo $this->formHidden('pageId', $this->pageId); ?>
        <?php echo $this->formHidden('pageAuthorId', 1); ?>
        <?php echo $this->formHidden('pageCreatedAt', $this->pageCreatedAt); ?>
        <?php echo $this->formHidden('pageUpdatedAt', ''); ?>

        <div>
            <label>
                <?php echo $this->T('Page link in url'); ?> : 
            </label>

            <?php
            echo $this->formText('pageLinkUrl', 
                                 $this->pageLinkUrl,
                                 array('maxlength' => 255, 'size' => '70')), ' .html';
            ?>
        </div>

        <div class="cl" style="height:15px;">&nbsp;</div>

        <div>
            <label><?php echo $this->T('Publish or not'); ?> : </label>
            <?php
            echo $this->formSelect('pagePublished',
                                   $this->pagePublished,
                                   null,
                                   array(0 => 'false', 1 => 'true'));
            ?>
        </div>

        <div class="cl" style="height:15px;">&nbsp;</div>

        <div>
            <?php /*echo $this->formSelect('postCategoryId', $this->postCategoryId, null, $this->categoryOptions);*/ ?>
        </div>

        <div class="cl" style="height:20px;">&nbsp;</div>

        <?php
        if (!empty($this->locales)) {
            foreach ($this->locales as $locale) {
        ?>
                <?php
                echo $this->formHidden('detailId[' . $locale->localeId . ']',
                                       $this->{'detailId_' . $locale->localeId});
                ?>

                <div class="fl">
                    <div>
                        <label>Link label (<?php echo $locale->localeTitle; ?>) : </label><br />
                        <?php
                        echo $this->formText('detailLinkLabel['.$locale->localeId.']',
                                             $this->{'detailLinkLabel_' . $locale->localeId},
                                             array('maxlength' => 255, 'size' => '70'));
                        ?>
                    </div>

                    <br />

                    <div>
                        <label>Content (<?php echo $locale->localeTitle; ?>) : </label><br />
                        <?php
                        echo $this->fckeditor('detailContent[' . $locale->localeId . ']',
                                              $this->{'detailContent_' . $locale->localeId},
                                              '550', '800'); ?>
                    </div>
                </div>


        <?php
            }
        }
        ?>

        <div class="cl" style="height:20px;">&nbsp;</div>

        <div>
            <?php echo $this->formSubmit('Save', 'Save'); ?>
        </div>

    </form>
</div>